<script context="module" lang="ts">
	export type DescriptionModel = {
		title: string;
		content?: any;
	};
</script>

<script lang="ts">
	import { PortableText } from "@portabletext/svelte";
	export let model: DescriptionModel;

	let visible = true;

	$: if (!model.title) {
		visible = false;
	} else {
		visible = true;
	}
</script>

{#if visible}
	<h3>{model.title}</h3>
	{#if model.content}
		<PortableText value={model.content} />
	{/if}
{/if}
